#!/bin/bash

# Method of use

# zabbix_agent.conf
# UserParameter=tcp.status[*],netstat -a | awk '/^tcp/ {++y[$NF]} END {for(i in y) print i,y[i]}' |  grep $1 | awk '{print $NF}'